<?php
$this->houseme_view->header();
?>
    <!-- masonry page nav-->
    <?php if(isset($page_next_link)){ ?>
    <div id="page-nav"><a id="page-next-link" href="<?php echo $page_next_link; ?>"></a></div>
    <?php } ?>
    <!-- masonry page nav-->
    
    <div id="filters" data-toggle="buttons">
            <a href="#" data-filter="*">所有類別</a>
            <a href="#" data-filter=".recommend">主題推荐</a>
            <a href="#" data-filter=".case">案例分享</a>
          <!--
          <label class="btn btn-link">
            <input type="checkbox" value="people" >
            人物訪談
          </label>
           -->
          
    </div>
    <!--照片清單-->
    <div id="topicList">
    <ul>      
        
        <?php if(!empty($all_topic)){
            $topic_category_mapping = $this->config->item('topic_category_mapping','layout');
        ?>
            <?php foreach ($all_topic as $key => $topic) {
                $doc = new DOMDocument();
                @$doc->loadHTML($topic['topic_desc']);
                $first_img = $doc->getElementsByTagName('img')->item(0);
                $first_img_src = $first_img->attributes->getNamedItem("src")->value;

            ?>
        <li class="topicIterms <?php echo $topic_category_mapping[$topic['topic_category']]; ?>">
        <a href="/topic/detail/<?php echo $topic['id'].'/' ?>">
        <img src="<?php echo $first_img_src;?>" width="200" height="150" />
        <!--
        <div class="btn_memberLike">123,456,789</div>
        <div class="btn_collect"></div>
        <div class="btn_sharefb"></div>
        
        -->
        <div class="btn_collect"><span>/topic/detail/<?php echo $topic['id'].'/'; ?></span></div>
        <?php if($topic['topic_category'] == '案例分享'){ ?>
            <div class="photoListInfo_04">
        <?php }elseif($topic['topic_category'] == '人物訪談'){ ?>
            <div class="photoListInfo_03">
        <?php }else{ ?>
            <div class="photoListInfo_02">
        <?php } ?>
        <?php echo $topic['topic_excerpt'] ?>
        </div></a></li>        
            <?php } ?>
        <?php } ?>
    </ul>
    <?php if(!empty($all_topic)){ ?>
        <div id="infscr-loading"><img alt="Loading..." src="/assets/img/ajax-loading.gif" /><div>Loading....</div></div>
    <?php }else{ echo $this->lang->line('can_not_find_topic'); } ?>
    <div class="endSpan"></div>
    </div>
<?php
$this->houseme_view->footer();
?>